# https://www.bilibili.com/video/BV1W7411G7wP?p=10&spm_id_from=pageDriver&vd_source=8bd7b24b38e3e12c558d839b352b32f4
import pandas as pd
import matplotlib.pyplot as plt

students = pd.read_excel('../resources/input_py_tools/010/Students.xlsx')
students.sort_values(by='2017', inplace=True, ascending=False)
print(students)

students.plot.bar(x='Field', y=['2016', '2017'], color=['orange', 'red'])
plt.title('International Students by Field', fontsize=16, fontweight='bold')
plt.xlabel('Field', fontweight='bold')
plt.ylabel('Number', fontweight='bold')
ax = plt.gca()
ax.set_xticklabels(students['Field'], rotation=45, ha='right')
f = plt.gcf()
f.subplots_adjust(left=0.2, bottom=0.45)
#plt.tight_layout()
plt.show()